﻿using Daemon.Common;
using Daemon.Model;
using Microsoft.AspNetCore.Mvc;
using Daemon.Repository.Contract;
using System.Net.Http;
using System.Linq;
using Microsoft.EntityFrameworkCore;
using Microsoft.AspNetCore.Http;
namespace DaemonAPI
{
    [ApiController]
    [Route("api/[controller]/[action]")]
    public class SecuredItemGroupController : BaseApiController<SecuredItemGroup, ISecuredItemGroupRepository>
    {
        private readonly ISecuredItemRepository _securedItemRepository;

        public SecuredItemGroupController(ISecuredItemRepository securedItemRepository, ISecuredItemGroupRepository repository, IHttpContextAccessor httpContextAccessor) : base(repository, httpContextAccessor)
        {
            _securedItemRepository = securedItemRepository;
        }

        [HttpGet]
        public ResultModel GetTreeMenu()
        {
            var result = _repository.FindAll().Include(r => r.SecuredItems);
            return new ResultModel();
        }
    }
}
